﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    [ObjectEvent]
    public class SetAsPowerComponentEvent : ObjectEvent<SetAsPowerComponent>, IAwake
    {
        public void Awake()
        {
            Get().Awake();
        }
    }
    public class SetAsPowerComponent : CardUseComponent, ICardUse, IIfCardUse
    {
        public override string UseInfo { get; set; } = CardUseWay.UseAsPower;

        public override bool IfUse(FightModel fightModel, BattlePlayer user)
        {
            BattleStatus battleStatus = fightModel.BattleStatus;
            if (battleStatus == BattleStatus.Set && baseCard.CardPlace == CardPlace.Hand)
            {
                return true;
            }
            /*if (battleStatus == BattleStatus.Set && (baseCard.IfSupport|| baseCard.IfCenter))
            {
                return true;
            }*/
            return false;
        }
        public override void Use(FightModel fightModel, BattlePlayer user)
        {
            BattleStatus battleStatus = fightModel.BattleStatus;
            if (battleStatus == BattleStatus.Set && baseCard.CardPlace == CardPlace.Hand)
            {
                user[CardPlace.Hand].MoveCards(user[CardPlace.Power],new List<BattleCard>() { baseCard} );
                baseCard.IfRightSide = false;
            }
            /*if (battleStatus == BattleStatus.Set && baseCard.IfSupport)
            {
                baseCard.IfStand = true;
            }
            if (battleStatus == BattleStatus.Set && baseCard.IfCenter)
            {
                user[CardPlace.Charactor].MoveCards(user[CardPlace.Duel_Charactor], new List<BattleCard>() { baseCard });
            }*/
        }
    }
}
